package com.fenghongzhang.day004rxjava;


import java.util.List;
import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface Api {

    @GET("/ios/cf/dish_list.php?stage_id=1&limit=20&page=1")
    Call<Food> getFood();

    @GET("/ios/cf/dish_list.php?stage_id=1&limit=20&page=1")
    Observable<Food> getFood1();


    @GET("/{ios}/cf/dish_list.php?stage_id=1")
        //https://gank.io/api/v2/data/category/Girl/type/Girl/page/1/count/10
    Observable<Food> getFood2(@Path("ios") String ios, @Query("page") int page, @Query("limit") int limit);


    @POST("/ios/cf/dish_list.php?stage_id=1&limit=20&page=1")
    Observable<Food> getFood3();

    @POST("/{ios}/cf/dish_list.php?stage_id=1&limit=20&page=1")
    Observable<Food> getFood4(@Path("ios") String ios);


    @POST("/login")
    @FormUrlEncoded
    Observable<User> login(@Field("name") String name,@Field("password") String password);



    @POST("/hfs")
    @Multipart
    Call<ResponseBody> uploadFile(@Part List<MultipartBody.Part> body);


}
